package com.esms.struts.service;

import java.sql.SQLException;
import java.util.List;

import com.esms.bean.Group;
import com.esms.bean.GroupDAO;
import com.esms.bean.Person;
import com.esms.bean.PersonDAO;;

public class GroupService {
	private GroupService() {}
	public static GroupService $ = new GroupService(); 
	
	public Group getGroup(String personType) throws SQLException {
		List groupList = GroupDAO.$.findByGroupname(personType);
		if(groupList.size() == 0)
			return null;
		else 
			return (Group) groupList.get(0);
	}
	
	public void updateRoleAssign(Group group) {
		GroupDAO.$.update(group);
	}
}
